package com.itheima.HomeWork.homework05;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class Demo {
    public static void main(String[] args) {
        LinkedHashMap<Student, String> map = new LinkedHashMap<>();
        map.put(new Student("123", "张三", 60), "山东");
        map.put(new Student("123", "李四", 90), "北京");
        map.put(new Student("456", "王五", 70), "上海");
        map.put(new Student("789", "小二", 66), "广东");
        map.put(new Student("111", "大海", 88), "西安");
        Set<Map.Entry<Student, String>> entries = map.entrySet();
        for (Map.Entry<Student, String> entry : entries) {
            Student key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key.getId() + " " + key.getName() + " " + key.getScore() + ":" + value);
        }
    }
}
